package tc.de.krawallmann.robobridge.util;

public class MathUtil {
	public static double interpolate(double value, double minVal, double maxVal, double minReturn, double maxReturn){
		double  lRtnRange;
		double lValRange;
		double lRelVal;

		lRtnRange = maxReturn - minReturn;
		lValRange = maxVal - minVal;
		lRelVal = value - minVal;
		lRtnRange =  minReturn + ( lRtnRange * lRelVal / lValRange );
		return lRtnRange;
	}
}
